<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>ssm整合</title>
  <!--引入vue-->
  <script th:src="@{/static/js/vue3.4.21.js}"></script>
  <!--引入axios-->
  <script th:src="@{/static/js/axios.min.js}"></script>
</head>
<body>
<div id="app">
  <button @click="getMessage">查看id=1的用户信息</button>
  <h1>{{message}}</h1>
</div>
<script th:inline="javascript">
  Vue.createApp({
    data(){
      return {
        message : ''
      }
    },
    methods : {
      async getMessage(){
        let response = await axios.get([[@{/}]] + 'users/1')
          this.message = response.data
      }
      }
    }).mount("#app")
</script>
</body>
</html>